import Cookies from 'js-cookie'

const CodeKey = 'verification-timeout'

export function getCodeTime(){
  return Cookies.get(CodeKey);
}

/**
 * @param seconds 指定多少秒可以重发
 */
export function setCodeTime(seconds){
  const date = new Date()
  return Cookies.set(CodeKey, seconds, {
    // 设置过期时间
    expires: new Date(date.getTime() +  seconds * 1000)
  })
}
